/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aula.alex;

/**
 *
 * @author 4810
 */
public class ExemploForEach 
{
    public static void main(String[] args)
    {
        int[] notas = {2, 5, 7, 9, 4, 18};
        int total = 0;
        for ( int n : notas )
        {
            total += n;
            System.out.println(n);
        }
        System.out.println( total );
    }
}